<?php
// Init owncloud
OCP\JSON::checkLoggedIn();
OCP\JSON::callCheck();

require_once(OC_App::getAppPath('resumes') . "/lib/resumes.php");
require_once(OC_App::getAppPath('resumes') . "/lib/search.php");

$model = new PResumesModelSearch();

$source = array_filter(explode(",", JRequest::getString('source', '')));
$job_id = JRequest::getInt('jobid',0);

// Get search info
$jobterms = array();
$jobterms = $model->getTermsByJobid($job_id, $source);

// offiset search terms html 
$tmpl = new OCP\Template('resumes', 'part.offsite.term', '');
$tmpl->assign('terms', $jobterms);

$tmpl->printPage();
